package com.share.base.action;

import com.share.base.dao.QueryFilter;

@SuppressWarnings("unchecked")
public class RequestContextFactory
{

    public static RequestContextFactory instance()
    {
        return instance;
    }

    private RequestContextFactory()
    {
    }

    public QueryFilter createQueryFilter(QueryFilter filter)
    {
        context.set(filter);
        return getQueryFilter();
    }

    public QueryFilter getQueryFilter()
    {
        return (QueryFilter)context.get();
    }


	public void destroyRequestContext()
    {
        context.set(null);
    }

    private static ThreadLocal context = new ThreadLocal();
    private static final RequestContextFactory instance = new RequestContextFactory();

}

